package com.cy.service;

import com.cy.common.ResultResponse;
import com.cy.entity.Courses;
import com.cy.entity.Usercourses;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;

import java.util.List;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Aleven
 * @since 2024-12-21
 */
public interface IUsercoursesService extends IService<Usercourses> {

    /**
     * 用户选择课程
     * @param userId
     * @param courseID
     * @return
     * @throws Exception
     */
    ResultResponse chooseCourse(Integer userId, Integer courseID) throws Exception;

    /**
     * 根据UserId查询已选课程
     * @param UserId
     * @return
     * @throws Exception
     */
    ResultResponse selectCourseRecordByUserId(@Param("UserId") Integer UserId) throws Exception;

    /**
     * 退课 即删除记录
     * @param UserCourseID
     * @return
     */
    ResultResponse exitCourse(@Param("UserCourseID") Integer UserCourseID) throws Exception;


    /**
     * 统计某个课程的选课人数
     * @param CourseID
     * @return
     */
     Integer countUsercourses(String CourseID);

    //根据用户兴趣推荐课程
    public List<Courses> RecommendByInterest(Integer UserID) ;

}
